<!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta charset="utf-8" />
		<title>登录 - 锦州市金融服务平台</title>
		<meta name="Keywords" content="金融,金融超市,企业贷款,锦州金融,中小微,贷款,中小微贷款,中小微金融,锦州贷款,锦州中小微,中小微企业" />
		<meta name="Description" content="依托锦州市城市大数据平台，为中小微企业与金融机构搭建的线上线下融资服务平台。金融机构作为“卖家”，在平台上发布融资产品，中小微企业作为“买家”在平台上选购融资产品，金融管理部门负责协调、管理和统计评价工作。" />
		<meta name="viewport" content="width=device-width,initial-scale=1" />
		<meta name="renderer" content="webkit" />
		<link rel="shortcut icon" href="favicon.ico" />
		<link rel="stylesheet" href="index/js/layui/css/layui.css" />
		<link rel="stylesheet" href="index/css/reset.css" />
		<link rel="stylesheet" href="index/css/login.css" />
	</head>

	<body>
		<div class="container">
			<div class="xy-header">
				<div class="bshr">
					<a class="title-jhdu" href="index.html" title="金融超市---锦州市金融服务平台"></a>
				</div>
			</div>
			<div class="xy-login">
				<div class="jzcu">
					<div class="rfii">
						<ul class="clearfix hosy" id="roleAovy">
							<li class="on" data-role="4">企业登录</li>
							<li data-role="1">银行登录</li>
							<li data-role="6">保险登录</li>
							<li data-role="8">证券登录</li>
							<li data-role="2">担保登录</li>
							<li data-role="7">金融专员登录</li>
							<li data-role="3">政府部门登录</li>
						</ul>
						<div class="utrg-main">
							<form action="javascript:;" autocomplete="off" class="utrg-box utrg-body layui-form">
								<input id="inputRoleJjur" type="hidden" name="typeId" value="4" />
								<div class="layui-form-item">
									<label class="utrg-icon layui-icon" for="dyrs-username">&#xe66f;</label>
									<input type="text" name="username" id="dyrs-username" lay-verify="required" placeholder="请输入用户名" class="layui-input layui-form-danger">
								</div>
								<div class="layui-form-item">
									<label class="utrg-icon layui-icon" for="dyrs-password">&#xe673;</label>
									<input type="password" name="password" id="dyrs-password" lay-verify="required" placeholder="请输入密码" class="layui-input">
								</div>
								<div class="layui-form-item">
									<div class="layui-row">
										<div class="layui-col-xs7">
											<label class="utrg-icon layui-icon" for="dyrs-vercode">&#xe679;</label>
											<input type="text" name="validateCode" id="dyrs-vercode" lay-verify="required" placeholder="请输入验证码" class="layui-input">
										</div>
										<div class="layui-col-xs5">
											<div class="pqum">
												<img class="utrg-codeimg" id="imgYzm">
											</div>
										</div>
									</div>
								</div>
								<div class="layui-form-item kllq">
									<button class="layui-btn layui-btn-fluid sxad" lay-submit lay-filter="formBuvq">登录</button>
								</div>
								<div class="layui-form-item">
									<div class="layui-row">
										<div class="layui-col-xs6">
											<a class="ogxc" href="javascript:;" id="gmxezj">立即注册<i class="jqwj"></i></a>
										</div>
										<div class="layui-col-xs6 peef">
											<a class="ogxc" href="javascript:;">忘记密码？</a>
										</div>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
			<div class="xy-footer">
				<p class="skga"></p>
			</div>
		</div>
		<script src="index/js/jquery.js"></script>
		<script src="index/js/layui/layui.js"></script>
		<script src="index/js/sdk.js"></script>
		<script>
			layui.use(['form'], function() {
				var form = layui.form;
				$('#roleAovy li').click(function() {
					$(this).addClass('on').siblings().removeClass('on');
					$('#inputRoleJjur').val($(this).attr('data-role'));
					console.log($('#inputRoleJjur').val());
				});
				changeValidateImg();
				//监听提交
				form.on('submit(formBuvq)', function(data) {
					var data = data.field;
					var acc = data.username;
					var psw = data.password;
					data.account = btoa(acc);
					data.password = btoa(psw);
					console.log(data.account)
					console.log(data.password)
					$.ajax({
						type: 'post',
						data: data,
						url: sdk.baseIP + 'zxw/company/login/loginCheck',
						success: function(d) {
							console.log(d)
							switch (d.code) {
								case '00':
									consoleMain()
									layer.msg('登录成功', {
										icon: 6,
										closeBtn: 1,
										time: 2000
									});
									// window.location.href = "http://120.199.82.52:5000/zxw/index/index.html"
									break;
								case '03':
									changeValidateImg();
									layer.msg(d.msg, {
										icon: 5,
										closeBtn: 1,
										time: 2000
									});
									break;
								case '05':
									changeValidateImg();
									layer.msg(d.msg, {
										icon: 5,
										closeBtn: 1,
										time: 2000
									});
									break;
								case '06':
									changeValidateImg();
									layer.msg(d.msg, {
										icon: 5,
										closeBtn: 1,
										time: 2000
									});
									break;
								default:
									changeValidateImg();
									layer.msg(d.msg);
									break;
							}
						}
					});
				});

				function changeValidateImg() {
					$('#imgYzm').attr('src', '').attr('src', sdk.baseIP + 'zxw/company/login/getRandomValidateCode?r=' + Math.random());
					form.val("formBuvq", {
						validateCode: ''
					});
				}
				// 个人信息
				function consoleMain() {
					$.ajax({
						type: 'post',
						url: sdk.baseIP + 'zxw/company/login/getLoginFlag',
						dataType: 'json',
						success: function(userinfo) {
							console.log(userinfo)
							debugger
							if (userinfo.loginFlag === 'true') {} else {
								$('.noLogin_yjfk').show();
								if ($('#header').attr('data-page') == 'pageXhjy1') {
									$('#eolxqk').addClass('hide');
								} else {
									$('#eolxqk').removeClass('hide');
								}
								try {
									// 飘窗用户下载
									$('#ppdpyc').show();
									move_obj('#ppdpyc');
								} catch (e) {}
							}
						}
					});

				}
			});
		</script>
	</body>

</html>
